package org.flycloud.web.util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class CookieUtil {

	public static Cookie getCookieByName(HttpServletRequest request, String key) {
		if (request.getCookies() == null) {
			return null;
		}
		for (Cookie c : request.getCookies()) {
			if (c.getName().equals(key)) {
				return c;
			}
		}
		return null;
	}

}
